<?php

require_once('../fpdf/fpdf.php');
require_once('../fpdf/LaravelPDF.php');

include '../db.php';
$connect = pg_connect($connectionString);
if (!$connect) {
    echo "connect : A connection to the server could not be established!";
    return false;
}
$queryString = "SELECT str_category,fullname,quantity
  FROM product order by category_id, subcategory_id";// LIMIT 10";
$query = pg_query($connect, $queryString);
$arrRegistros = pg_fetch_all($query);
pg_close($connect);

/* foreach ($arrRegistros as $values) {
  foreach ($values as $value) {
  echo $value."<br>";
  }
  } */


$pdf = new LaravelPDF();
$pdf->title = 'Reporte Unidades';
$pdf->labels = array( array(50, "Categoria - Subcategoria", "L"), array(120, "Descripcion", "L"), array(20, "Cantidad", "C"));
$pdf->data = $arrRegistros;
$pdf->process();

